home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / emacs-complete / fsf / emacs / info / emacs-3 < prev    next >
Encoding:
GNU Info File  |  1994-10-06  |  48.6 KB  |  1,193 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Position Info,  Next: Arguments,  Prev: Continuation Lines,  Up: Basic
  6.  
  7. Cursor Position Information
  8. ===========================
  9.  
  10.    Here are commands to get information about the size and position of
  11. parts of the buffer, and to count lines.
  12.  
  13. `M-x what-page'
  14.      Print page number of point, and line number within page.
  15.  
  16. `M-x what-line'
  17.      Print line number of point in the buffer.
  18.  
  19. `M-x line-number-mode'
  20.      Toggle automatic display of current line number.
  21.  
  22. `M-='
  23.      Print number of lines in the current region (`count-lines-region').
  24.  
  25. `C-x ='
  26.      Print character code of character after point, character position
  27.      of point, and column of point (`what-cursor-position').
  28.  
  29.    There are two commands for printing the current line number.  `M-x
  30. what-line' computes the current line number and displays it in the echo
  31. area.  `M-x line-number-mode' enables display of the current line
  32. number in the mode line; once you turn this on, the number updates as
  33. you move point, so it remains valid all the time.  *Note Mode Line::.
  34.  
  35.    Line numbers count from one at the beginning of the buffer.  To go to
  36. a given line by number, use `M-x goto-line'; it prompts you for the
  37. line number.
  38.  
  39.    By contrast, `M-x what-page' counts pages from the beginning of the
  40. file, and counts lines within the page, printing both numbers.  *Note
  41. Pages::.
  42.  
  43.    While on this subject, we might as well mention `M-='
  44. (`count-lines-region'), which prints the number of lines in the region
  45. (*note Mark::.).  *Note Pages::, for the command `C-x l' which counts
  46. the lines in the current page.
  47.  
  48.    The command `C-x =' (`what-cursor-position') can be used to find out
  49. the column that the cursor is in, and other miscellaneous information
  50. about point.  It prints a line in the echo area that looks like this:
  51.  
  52.      Char: x (0170)  point=65986 of 563027(12%)  x=44
  53.  
  54. (In fact, this is the output produced when point is before the `x=44'
  55. in the example.)
  56.  
  57.    The two values after `Char:' describe the character that follows
  58. point, first by showing it and second by giving its octal character
  59. code.
  60.  
  61.    `point=' is followed by the position of point expressed as a
  62. character count.  The front of the buffer counts as position 1, one
  63. character later as 2, and so on.  The next, larger number is the total
  64. number of characters in the buffer.  Afterward in parentheses comes the
  65. position expressed as a percentage of the total size.
  66.  
  67.    `x=' is followed by the horizontal position of point, in columns
  68. from the left edge of the window.
  69.  
  70.    If the buffer has been narrowed, making some of the text at the
  71. beginning and the end temporarily inaccessible, `C-x =' prints
  72. additional text describing the currently accessible range.  For
  73. example, it might display this:
  74.  
  75.      Char: x (0170)  point=65986 of 563025(12%) <65102 - 68533>  x=44
  76.  
  77. where the two extra numbers give the smallest and largest character
  78. position that point is allowed to assume.  The characters between those
  79. two positions are the accessible ones.  *Note Narrowing::.
  80.  
  81.    If point is at the end of the buffer (or the end of the accessible
  82. part), `C-x =' omits any description of the character after point.  The
  83. output looks like this:
  84.  
  85.      point=563026 of 563025(100%)  x=0
  86.  
  87. 
  88. File: emacs,  Node: Arguments,  Prev: Position Info,  Up: Basic
  89.  
  90. Numeric Arguments
  91. =================
  92.  
  93.    Any Emacs command can be given a "numeric argument" (also called a
  94. "prefix argument").  Some commands interpret the argument as a
  95. repetition count.  For example, `C-f' with an argument of ten moves
  96. forward ten characters instead of one.  With these commands, no argument
  97. is equivalent to an argument of one.  Negative arguments tell most such
  98. commands to move or act in the opposite direction.
  99.  
  100.    If your terminal keyboard has a META key, the easiest way to specify
  101. a numeric argument is to type digits and/or a minus sign while holding
  102. down the the META key.  For example,
  103.      M-5 C-n
  104.  
  105. would move down five lines.  The characters `Meta-1', `Meta-2', and so
  106. on, as well as `Meta--', do this because they are keys bound to
  107. commands (`digit-argument' and `negative-argument') that are defined to
  108. contribute to an argument for the next command.
  109.  
  110.    Another way of specifying an argument is to use the `C-u'
  111. (`universal-argument') command followed by the digits of the argument.
  112. With `C-u', you can type the argument digits without holding down
  113. modifier keys; `C-u' works on all terminals.  To type a negative
  114. argument, type a minus sign after `C-u'.  Just a minus sign without
  115. digits normally means -1.
  116.  
  117.    `C-u' followed by a character which is neither a digit nor a minus
  118. sign has the special meaning of "multiply by four".  It multiplies the
  119. argument for the next command by four.  `C-u' twice multiplies it by
  120. sixteen.  Thus, `C-u C-u C-f' moves forward sixteen characters.  This
  121. is a good way to move forward "fast", since it moves about 1/5 of a line
  122. in the usual size screen.  Other useful combinations are `C-u C-n',
  123. `C-u C-u C-n' (move down a good fraction of a screen), `C-u C-u C-o'
  124. (make "a lot" of blank lines), and `C-u C-k' (kill four lines).
  125.  
  126.    Some commands care only about whether there is an argument, and not
  127. about its value.  For example, the command `M-q' (`fill-paragraph') with
  128. no argument fills text; with an argument, it justifies the text as well.
  129. (*Note Filling::, for more information on `M-q'.)  Plain `C-u' is a
  130. handy way of providing an argument for such commands.
  131.  
  132.    Some commands use the value of the argument as a repeat count, but do
  133. something peculiar when there is no argument.  For example, the command
  134. `C-k' (`kill-line') with argument N kills N lines, including their
  135. terminating newlines.  But `C-k' with no argument is special: it kills
  136. the text up to the next newline, or, if point is right at the end of
  137. the line, it kills the newline itself.  Thus, two `C-k' commands with
  138. no arguments can kill a nonblank line, just like `C-k' with an argument
  139. of one.  (*Note Killing::, for more information on `C-k'.)
  140.  
  141.    A few commands treat a plain `C-u' differently from an ordinary
  142. argument.  A few others may treat an argument of just a minus sign
  143. differently from an argument of -1.  These unusual cases are described
  144. when they come up; they are always for reasons of convenience of use of
  145. the individual command.
  146.  
  147.    You can use a numeric argument to insert multiple copies of a
  148. character.  This is straightforward unless the character is a digit; for
  149. example, `C-u 6 4 a' inserts 64 copies of the character `a'.  But this
  150. does not work for inserting digits; `C-u 6 4 1' specifies an argument
  151. of 641, rather than inserting anything.  To separate the digit to
  152. insert from the argument, type another `C-u'; for example, `C-u 6 4 C-u
  153. 1' does insert 64 copies of the character `1'.
  154.  
  155.    We use the term "prefix argument" as well as "numeric argument" to
  156. emphasize that you type the argument before the command, and to
  157. distinguish these arguments from minibuffer arguments that come after
  158. the command.
  159.  
  160. 
  161. File: emacs,  Node: Minibuffer,  Next: M-x,  Prev: Basic,  Up: Top
  162.  
  163. The Minibuffer
  164. **************
  165.  
  166.    The "minibuffer" is the facility used by Emacs commands to read
  167. arguments more complicated than a single number.  Minibuffer arguments
  168. can be file names, buffer names, Lisp function names, Emacs command
  169. names, Lisp expressions, and many other things, depending on the command
  170. reading the argument.  You can use the usual Emacs editing commands in
  171. the minibuffer to edit the argument text.
  172.  
  173.    When the minibuffer is in use, it appears in the echo area, and the
  174. terminal's cursor moves there.  The beginning of the minibuffer line
  175. displays a "prompt" which says what kind of input you should supply and
  176. how it will be used.  Often this prompt is derived from the name of the
  177. command that the argument is for.  The prompt normally ends with a
  178. colon.
  179.  
  180.    Sometimes a "default argument" appears in parentheses after the
  181. colon; it too is part of the prompt.  The default will be used as the
  182. argument value if you enter an empty argument (e.g., just type RET).
  183. For example, commands that read buffer names always show a default,
  184. which is the name of the buffer that will be used if you type just RET.
  185.  
  186.    The simplest way to enter a minibuffer argument is to type the text
  187. you want, terminated by RET which exits the minibuffer.  You can cancel
  188. the command that wants the argument, and get out of the minibuffer, by
  189. typing `C-g'.
  190.  
  191.    Since the minibuffer uses the screen space of the echo area, it can
  192. conflict with other ways Emacs customarily uses the echo area.  Here is
  193. how Emacs handles such conflicts:
  194.  
  195.    * If a command gets an error while you are in the minibuffer, this
  196.      does not cancel the minibuffer.  However, the echo area is needed
  197.      for the error message and therefore the minibuffer itself is
  198.      hidden for a while.  It comes back after a few seconds, or as soon
  199.      as you type anything.
  200.  
  201.    * If in the minibuffer you use a command whose purpose is to print a
  202.      message in the echo area, such as `C-x =', the message is printed
  203.      normally, and the minibuffer is hidden for a while.  It comes back
  204.      after a few seconds, or as soon as you type anything.
  205.  
  206.    * Echoing of keystrokes does not take place while the minibuffer is
  207.      in use.
  208.  
  209. * Menu:
  210.  
  211. * File: Minibuffer File.  Entering file names with the minibuffer.
  212. * Edit: Minibuffer Edit.  How to edit in the minibuffer.
  213. * Completion::          An abbreviation facility for minibuffer input.
  214. * Minibuffer History::    Reusing recent minibuffer arguments.
  215. * Repetition::          Re-executing commands that used the minibuffer.
  216.  
  217. 
  218. File: emacs,  Node: Minibuffer File,  Next: Minibuffer Edit,  Up: Minibuffer
  219.  
  220. Minibuffers for File Names
  221. ==========================
  222.  
  223.    Sometimes the minibuffer starts out with text in it.  For example,
  224. when you are supposed to give a file name, the minibuffer starts out
  225. containing the "default directory", which ends with a slash.  This is
  226. to inform you which directory the file will be found in if you do not
  227. specify a directory.
  228.  
  229.    For example, the minibuffer might start out with these contents:
  230.  
  231.      Find File: /u2/emacs/src/
  232.  
  233. where `Find File: ' is the prompt.  Typing `buffer.c' specifies the
  234. file `/u2/emacs/src/buffer.c'.  To find files in nearby directories,
  235. use `..'; thus, if you type `../lisp/simple.el', you will get the file
  236. named `/u2/emacs/lisp/simple.el'.  Alternatively, you can kill with
  237. `M-DEL' the directory names you don't want (*note Words::.).
  238.  
  239.    If you don't want any of the default, you can kill it with `C-a
  240. C-k'.  But you don't need to kill the default; you can simply ignore it.
  241. Insert an absolute file name, one starting with a slash or a tilde,
  242. after the default directory.  For example, to specify the file
  243. `/etc/termcap', just insert that name, giving these minibuffer contents:
  244.  
  245.      Find File: /u2/emacs/src//etc/termcap
  246.  
  247. Two slashes in a row are not normally meaningful in a file name, but
  248. they are allowed in GNU Emacs.  They mean, "ignore everything before
  249. the second slash in the pair."  Thus, `/u2/emacs/src/' is ignored in
  250. the example above, and you get the file `/etc/termcap'.
  251.  
  252.    If you set `insert-default-directory' to `nil', the default
  253. directory is not inserted in the minibuffer.  This way, the minibuffer
  254. starts out empty.  But the name you type, if relative, is still
  255. interpreted with respect to the same default directory.
  256.  
  257. 
  258. File: emacs,  Node: Minibuffer Edit,  Next: Completion,  Prev: Minibuffer File,  Up: Minibuffer
  259.  
  260. Editing in the Minibuffer
  261. =========================
  262.  
  263.    The minibuffer is an Emacs buffer (albeit a peculiar one), and the
  264. usual Emacs commands are available for editing the text of an argument
  265. you are entering.
  266.  
  267.    Since RET in the minibuffer is defined to exit the minibuffer, you
  268. can't use it to insert a newline in the minibuffer.  To do that, type
  269. `C-o' or `C-q LFD'.  (Recall that a newline is really the LFD
  270. character.)
  271.  
  272.    The minibuffer has its own window which always has space on the
  273. screen but acts as if it were not there when the minibuffer is not in
  274. use.  When the minibuffer is in use, its window is just like the
  275. others; you can switch to another window with `C-x o', edit text in
  276. other windows and perhaps even visit more files, before returning to
  277. the minibuffer to submit the argument.  You can kill text in another
  278. window, return to the minibuffer window, and then yank the text to use
  279. it in the argument.  *Note Windows::.
  280.  
  281.    There are some restrictions on the use of the minibuffer window,
  282. however.  You cannot switch buffers in it--the minibuffer and its
  283. window are permanently attached.  Also, you cannot split or kill the
  284. minibuffer window.  But you can make it taller in the normal fashion
  285. with `C-x ^'.  If you enable Resize-Minibuffer mode, then the
  286. minibuffer window expands vertically as necessary to hold the text that
  287. you put in the minibuffer.  Use `M-x resize-minibuffer-mode' to enable
  288. or disable this minor mode (*note Minor Modes::.).
  289.  
  290.    If while in the minibuffer you issue a command that displays help
  291. text of any sort in another window, you can use the `C-M-v' command
  292. while in the minibuffer to scroll the help text.  This lasts until you
  293. exit the minibuffer.  This feature is especially useful if a completing
  294. minibuffer gives you a list of possible completions.  *Note Other
  295. Window::.
  296.  
  297.    Emacs normally disallows most commands that use the minibuffer while
  298. the minibuffer is selected.  This rule is to prevent recursive
  299. minibuffers from confusing novice users.  If you want to be able to use
  300. such commands in the minibuffer, set the variable
  301. `enable-recursive-minibuffers' to a non-`nil' value.
  302.  
  303. 
  304. File: emacs,  Node: Completion,  Next: Minibuffer History,  Prev: Minibuffer Edit,  Up: Minibuffer
  305.  
  306. Completion
  307. ==========
  308.  
  309.    For certain kinds of arguments, you can use "completion" to enter
  310. the argument value.  Completion means that you type part of the
  311. argument, then Emacs visibly fills in the rest, or as much as can be
  312. determined from the part you have typed.
  313.  
  314.    When completion is available, certain keys--TAB, RET, and SPC--are
  315. rebound to complete the text present in the minibuffer into a longer
  316. string that it stands for, by matching it against a set of "completion
  317. alternatives" provided by the command reading the argument.  `?' is
  318. defined to display a list of possible completions of what you have
  319. inserted.
  320.  
  321.    For example, when `M-x' uses the minibuffer to read the name of a
  322. command, it provides a list of all available Emacs command names to
  323. complete against.  The completion keys match the text in the minibuffer
  324. against all the command names, find any additional name characters
  325. implied by the ones already present in the minibuffer, and add those
  326. characters to the ones you have given.  This is what makes it possible
  327. to type `M-x ins SPC b RET' instead of `M-x insert-buffer RET' (for
  328. example).
  329.  
  330.    Case is normally significant in completion, because it is significant
  331. in most of the names that you can complete (buffer names, file names and
  332. command names).  Thus, `fo' does not complete to `Foo'.  Completion
  333. does ignore case distinctions for certain arguments in which case does
  334. not matter.
  335.  
  336. * Menu:
  337.  
  338. * Example: Completion Example.
  339. * Commands: Completion Commands.
  340. * Strict Completion::
  341. * Options: Completion Options.
  342.  
  343. 
  344. File: emacs,  Node: Completion Example,  Next: Completion Commands,  Up: Completion
  345.  
  346. Completion Example
  347. ------------------
  348.  
  349.    A concrete example may help here.  If you type `M-x au TAB', the TAB
  350. looks for alternatives (in this case, command names) that start with
  351. `au'.  There are only two: `auto-fill-mode' and `auto-save-mode'.
  352. These are the same as far as `auto-', so the `au' in the minibuffer
  353. changes to `auto-'.
  354.  
  355.    If you type TAB again immediately, there are multiple possibilities
  356. for the very next character--it could be `s' or `f'--so no more
  357. characters are added; instead, TAB displays a list of all possible
  358. completions in another window.
  359.  
  360.    If you go on to type `f TAB', this TAB sees `auto-f'.  The only
  361. command name starting this way is `auto-fill-mode', so completion fills
  362. in the rest of that.  You now have `auto-fill-mode' in the minibuffer
  363. after typing just `au TAB f TAB'.  Note that TAB has this effect
  364. because in the minibuffer it is bound to the command
  365. `minibuffer-complete' when completion is available.
  366.  
  367. 
  368. File: emacs,  Node: Completion Commands,  Next: Strict Completion,  Prev: Completion Example,  Up: Completion
  369.  
  370. Completion Commands
  371. -------------------
  372.  
  373.    Here is a list of the completion commands defined in the minibuffer
  374. when completion is available.
  375.  
  376. `TAB'
  377.      Complete the text in the minibuffer as much as possible
  378.      (`minibuffer-complete').
  379.  
  380. `SPC'
  381.      Complete the minibuffer text, but don't go beyond one word
  382.      (`minibuffer-complete-word').
  383.  
  384. `RET'
  385.      Submit the text in the minibuffer as the argument, possibly
  386.      completing first as described below
  387.      (`minibuffer-complete-and-exit').
  388.  
  389. `?'
  390.      Print a list of all possible completions of the text in the
  391.      minibuffer (`minibuffer-list-completions').
  392.  
  393.    SPC completes much like TAB, but never goes beyond the next hyphen
  394. or space.  If you have `auto-f' in the minibuffer and type SPC, it
  395. finds that the completion is `auto-fill-mode', but it stops completing
  396. after `fill-'.  This gives `auto-fill-'.  Another SPC at this point
  397. completes all the way to `auto-fill-mode'.  SPC in the minibuffer when
  398. completion is available runs the command `minibuffer-complete-word'.
  399.  
  400.    Here are some commands you can use to choose a completion from a
  401. window that displays a list of completions:
  402.  
  403. `Mouse-2'
  404.      Clicking mouse button 2 on a completion in the list of possible
  405.      completions chooses that completion (`mouse-choose-completion').
  406.      You use this command while you are in the minibuffer; but you must
  407.      click in the list of completions, not in the minibuffer itself.
  408.  
  409. `RET'
  410.      Typing RET *in the completion list buffer* chooses the completion
  411.      that point is in or next to (`choose-completion').  To use this
  412.      command, you must first switch windows to the window that shows
  413.      the list of completions.
  414.  
  415. 
  416. File: emacs,  Node: Strict Completion,  Next: Completion Options,  Prev: Completion Commands,  Up: Completion
  417.  
  418. Strict Completion
  419. -----------------
  420.  
  421.    There are three different ways that RET can work in completing
  422. minibuffers, depending on how the argument will be used.
  423.  
  424.    * "Strict" completion is used when it is meaningless to give any
  425.      argument except one of the known alternatives.  For example, when
  426.      `C-x k' reads the name of a buffer to kill, it is meaningless to
  427.      give anything but the name of an existing buffer.  In strict
  428.      completion, RET refuses to exit if the text in the minibuffer does
  429.      not complete to an exact match.
  430.  
  431.    * "Cautious" completion is similar to strict completion, except that
  432.      RET exits only if the text was an exact match already, not needing
  433.      completion.  If the text is not an exact match, RET does not exit,
  434.      but it does complete the text.  If it completes to an exact match,
  435.      a second RET will exit.
  436.  
  437.      Cautious completion is used for reading file names for files that
  438.      must already exist.
  439.  
  440.    * "Permissive" completion is used when any string whatever is
  441.      meaningful, and the list of completion alternatives is just a
  442.      guide.  For example, when `C-x C-f' reads the name of a file to
  443.      visit, any file name is allowed, in case you want to create a
  444.      file.  In permissive completion, RET takes the text in the
  445.      minibuffer exactly as given, without completing it.
  446.  
  447.    The completion commands display a list of all possible completions in
  448. a window whenever there is more than one possibility for the very next
  449. character.  Also, typing `?' explicitly requests such a list.  If the
  450. list of completions is long, you can scroll it with `C-M-v' (*note
  451. Other Window::.).
  452.  
  453. 
  454. File: emacs,  Node: Completion Options,  Prev: Strict Completion,  Up: Completion
  455.  
  456. Completion Options
  457. ------------------
  458.  
  459.    When completion is done on file names, certain file names are usually
  460. ignored.  The variable `completion-ignored-extensions' contains a list
  461. of strings; a file whose name ends in any of those strings is ignored
  462. as a possible completion.  The standard value of this variable has
  463. several elements including `".o"', `".elc"', `".dvi"' and `"~"'.  The
  464. effect is that, for example, `foo' can complete to `foo.c' even though
  465. `foo.o' exists as well.  However, if *all* the possible completions end
  466. in "ignored" strings, then they are not ignored.  Ignored extensions do
  467. not apply to lists of completions--those always mention all possible
  468. completions.
  469.  
  470.    Normally, a completion command that finds the next character is
  471. undetermined automatically displays a list of all possible completions.
  472. If the variable `completion-auto-help' is set to `nil', this does not
  473. happen, and you must type `?' to display the possible completions.
  474.  
  475.    The `complete' library implements a more powerful kind of completion
  476. that can complete multiple words at a time.  For example, it can
  477. complete the command name abbreviation `p-b' into `print-buffer',
  478. because no other command starts with two words whose initials are `p'
  479. and `b'.  To use this library, put `(load "complete")' in your
  480. `~/.emacs' file (*note Init File::.).
  481.  
  482.    The `icomplete' library does not change what completion does, but it
  483. presents a constantly updated display that tells you what completions
  484. are available.  To use this library, put `(load "icomplete")' in your
  485. `~/.emacs' file.
  486.  
  487. 
  488. File: emacs,  Node: Minibuffer History,  Next: Repetition,  Prev: Completion,  Up: Minibuffer
  489.  
  490. Minibuffer History
  491. ==================
  492.  
  493.    Every argument that you enter with the minibuffer is saved on a
  494. "minibuffer history list" so that you can use it again later in another
  495. argument.  Special commands load the text of an earlier argument in the
  496. minibuffer.  They discard the old minibuffer contents, so you can think
  497. of them as moving through the history of previous arguments.
  498.  
  499. `M-p'
  500.      Move to the next earlier argument string saved in the minibuffer
  501.      history (`previous-history-element').
  502.  
  503. `M-n'
  504.      Move to the next later argument string saved in the minibuffer
  505.      history (`next-history-element').
  506.  
  507. `M-r REGEXP RET'
  508.      Move to an earlier saved argument in the minibuffer history that
  509.      has a match for REGEXP (`previous-matching-history-element').
  510.  
  511. `M-s REGEXP RET'
  512.      Move to a later saved argument in the minibuffer history that has a
  513.      match for REGEXP (`next-matching-history-element').
  514.  
  515.    The simplest way to reuse the saved arguments in the history list is
  516. to move through the history list one element at a time.  While in the
  517. minibuffer, type `M-p' (`previous-history-element') to "move to" the
  518. next earlier minibuffer input, and use `M-n' (`next-history-element')
  519. to "move to" the next later input.
  520.  
  521.    The previous input that you fetch from the history entirely replaces
  522. the contents of the minibuffer.  To use it as the argument, exit the
  523. minibuffer as usual with RET.  You can also edit the text before you
  524. reuse it; this does not change the history element that you "moved" to,
  525. but your new argument does go at the end of the history list in its own
  526. right.
  527.  
  528.    There are also commands to search forward or backward through the
  529. history.  As of this writing, they search for history elements that
  530. match a regular expression that you specify with the minibuffer.  `M-r'
  531. (`previous-matching-history-element') searches older elements in the
  532. history, while `M-s' (`next-matching-history-element') searches newer
  533. elements.  By special dispensation, these commands can use the
  534. minibuffer to read their arguments even though you are already in the
  535. minibuffer when you issue them.
  536.  
  537.    All uses of the minibuffer record your input on a history list, but
  538. there are separate history lists for different kinds of arguments.  For
  539. example, there is a list for file names, used by all the commands that
  540. read file names.  There is a list for arguments of commands like
  541. `query-replace'.  There are several very specific history lists,
  542. including one for command names read by M-x and one for compilation
  543. commands read by `compile'.  Finally, there is one "miscellaneous"
  544. history list that most minibuffer arguments use.
  545.  
  546. 
  547. File: emacs,  Node: Repetition,  Prev: Minibuffer History,  Up: Minibuffer
  548.  
  549. Repeating Minibuffer Commands
  550. =============================
  551.  
  552.    Every command that uses the minibuffer at least once is recorded on a
  553. special history list, together with the values of its arguments, so that
  554. you can repeat the entire command.  In particular, every use of `M-x'
  555. is recorded there, since `M-x' uses the minibuffer to read the command
  556. name.
  557.  
  558. `C-x ESC ESC'
  559.      Re-execute a recent minibuffer command (`repeat-complex-command').
  560.  
  561. `M-x list-command-history'
  562.      Display the entire command history, showing all the commands `C-x
  563.      ESC ESC' can repeat, most recent first.
  564.  
  565.    `C-x ESC ESC' is used to re-execute a recent minibuffer-using
  566. command.  With no argument, it repeats the last such command.  A
  567. numeric argument specifies which command to repeat; one means the last
  568. one, and larger numbers specify earlier ones.
  569.  
  570.    `C-x ESC ESC' works by turning the previous command into a Lisp
  571. expression and then entering a minibuffer initialized with the text for
  572. that expression.  If you type just RET, the command is repeated as
  573. before.  You can also change the command by editing the Lisp
  574. expression.  Whatever expression you finally submit is what will be
  575. executed.  The repeated command is added to the front of the command
  576. history unless it is identical to the most recently executed command
  577. already there.
  578.  
  579.    Even if you don't understand Lisp syntax, it will probably be obvious
  580. which command is displayed for repetition.  If you do not change the
  581. text, it will repeat exactly as before.
  582.  
  583.    Once inside the minibuffer for `C-x ESC ESC', you can use the
  584. minibuffer history commands (`M-p', `M-n', `M-r', `M-s'; *note
  585. Minibuffer History::.) to move through the history list of saved entire
  586. commands.  After finding the desired previous command, you can edit its
  587. expression as usual and then resubmit it by typing RET as usual.
  588.  
  589.    The list of previous minibuffer-using commands is stored as a Lisp
  590. list in the variable `command-history'.  Each element is a Lisp
  591. expression which describes one command and its arguments.  Lisp programs
  592. can reexecute a command by calling `eval' with the `command-history'
  593. element.
  594.  
  595. 
  596. File: emacs,  Node: M-x,  Next: Help,  Prev: Minibuffer,  Up: Top
  597.  
  598. Running Commands by Name
  599. ************************
  600.  
  601.    The Emacs commands that are used often or that must be quick to type
  602. are bound to keys--short sequences of characters--for convenient use.
  603. Other Emacs commands that do not need to be brief are not bound to
  604. keys; to run them, you must refer to them by name.
  605.  
  606.    A command name is, by convention, made up of one or more words,
  607. separated by hyphens; for example, `auto-fill-mode' or `manual-entry'.
  608. The use of English words makes the command name easier to remember than
  609. a key made up of obscure characters, even though it is more characters
  610. to type.
  611.  
  612.    The way to run a command by name is to start with `M-x', type the
  613. command name, and finish it with RET.  `M-x' uses the minibuffer to
  614. read the command name.  RET exits the minibuffer and runs the command.
  615. The string `M-x' appears at the beginning of the minibuffer as a
  616. "prompt" to remind you to enter the name of a command to be run.  *Note
  617. Minibuffer::, for full information on the features of the minibuffer.
  618.  
  619.    You can use completion to enter the command name.  For example, the
  620. command `forward-char' can be invoked by name by typing
  621.  
  622.      M-x forward-char RET
  623.  
  624. or
  625.  
  626.      M-x forw TAB c RET
  627.  
  628. Note that `forward-char' is the same command that you invoke with the
  629. key `C-f'.  You can run any Emacs command by name using `M-x', whether
  630. or not any keys are bound to it.
  631.  
  632.    If you type `C-g' while the command name is being read, you cancel
  633. the `M-x' command and get out of the minibuffer, ending up at top level.
  634.  
  635.    To pass a numeric argument to the command you are invoking with
  636. `M-x', specify the numeric argument before the `M-x'.  `M-x' passes the
  637. argument along to the command it runs.  The argument value appears in
  638. the prompt while the command name is being read.
  639.  
  640.    Normally, when describing a command that is run by name, we omit the
  641. RET that is needed to terminate the name.  Thus we might speak of `M-x
  642. auto-fill-mode' rather than `M-x auto-fill-mode RET'.  We mention the
  643. RET only when there is a need to emphasize its presence, such as when
  644. we show the command together with following arguments.
  645.  
  646.    `M-x' works by running the command `execute-extended-command', which
  647. is responsible for reading the name of another command and invoking it.
  648.  
  649. 
  650. File: emacs,  Node: Help,  Next: Mark,  Prev: M-x,  Up: Top
  651.  
  652. Help
  653. ****
  654.  
  655.    Emacs provides extensive help features accessible through a single
  656. character, `C-h'.  `C-h' is a prefix key that is used only for
  657. documentation-printing commands.  The characters that you can type after
  658. `C-h' are called "help options".  One help option is `C-h'; that is how
  659. you ask for help about using `C-h'.  To cancel, type `C-g'.
  660.  
  661.    `C-h C-h' displays a list of the possible help options, each with a
  662. brief description.  Before you type a help option, you can use SPC or
  663. DEL to scroll through the list.
  664.  
  665.    `C-h' means "help" in various other contexts as well.  For example,
  666. in `query-replace', it describes the options available.  After a prefix
  667. key, it displays a list of the alternatives that can follow the prefix
  668. key.  (A few prefix keys don't support this because they define other
  669. meanings for `C-h'.)
  670.  
  671. * Menu:
  672.  
  673. * Help Summary::    Brief list of all Help commands.
  674. * Key Help::        Asking what a key does in Emacs.
  675. * Name Help::        Asking about a command, variable or function name.
  676. * Apropos::        Asking what pertains to a given topic.
  677. * Library Keywords::    Finding Lisp libraries by keywords (topics).
  678. * Misc Help::        Other help commands.
  679.  
  680. 
  681. File: emacs,  Node: Help Summary,  Next: Key Help,  Up: Help
  682.  
  683. Help Summary
  684. ============
  685.  
  686.    Here is a summary of the defined help commands.
  687.  
  688. `C-h a REGEXP RET'
  689.      Display list of commands whose names match REGEXP
  690.      (`command-apropos').
  691.  
  692. `C-h b'
  693.      Display a table of all key bindings in effect now, in this order:
  694.      minor mode bindings, major mode bindings, and global bindings
  695.      (`describe-bindings').
  696.  
  697. `C-h c KEY'
  698.      Print the name of the command that KEY runs
  699.      (`describe-key-briefly').  Here `c' stands for `character'.  For
  700.      more extensive information on KEY, use `C-h k'.
  701.  
  702. `C-h f FUNCTION RET'
  703.      Display documentation on the Lisp function named FUNCTION
  704.      (`describe-function').  Since commands are Lisp functions, a
  705.      command name may be used.
  706.  
  707. `C-h i'
  708.      Run Info, the program for browsing documentation files (`info').
  709.      The complete Emacs manual is available on-line in Info.
  710.  
  711. `C-h k KEY'
  712.      Display name and documentation of the command that KEY runs
  713.      (`describe-key').
  714.  
  715. `C-h l'
  716.      Display a description of the last 100 characters you typed
  717.      (`view-lossage').
  718.  
  719. `C-h m'
  720.      Display documentation of the current major mode (`describe-mode').
  721.  
  722. `C-h n'
  723.      Display documentation of Emacs changes, most recent first
  724.      (`view-emacs-news').
  725.  
  726. `C-h p'
  727.      Find packages by topic keyword (`finder-by-keyword').
  728.  
  729. `C-h s'
  730.      Display current contents of the syntax table, plus an explanation
  731.      of what they mean (`describe-syntax').  *Note Syntax::.
  732.  
  733. `C-h t'
  734.      Enter the Emacs interactive tutorial (`help-with-tutorial').
  735.  
  736. `C-h v VAR RET'
  737.      Display the documentation of the Lisp variable VAR
  738.      (`describe-variable').
  739.  
  740. `C-h w COMMAND RET'
  741.      Print which keys run the command named COMMAND (`where-is').
  742.  
  743. `C-h C-f FUNCTION RET'
  744.      Enter Info and go to the node documenting the Emacs function
  745.      FUNCTION (`info-goto-emacs-command-node').
  746.  
  747. `C-h C-k KEY'
  748.      Enter Info and go to the node where the key sequence KEY is
  749.      documented (`info-goto-emacs-key-command-node').
  750.  
  751. `C-h C-c'
  752.      Display the copying conditions for GNU Emacs.
  753.  
  754. `C-h C-d'
  755.      Display information about getting new versions of GNU Emacs.
  756.  
  757. `C-h C-p'
  758.      Display information about the GNU Project.
  759.  
  760. 
  761. File: emacs,  Node: Key Help,  Next: Name Help,  Prev: Help Summary,  Up: Help
  762.  
  763. Documentation for a Key
  764. =======================
  765.  
  766.    The most basic `C-h' options are `C-h c' (`describe-key-briefly')
  767. and `C-h k' (`describe-key').  `C-h c KEY' prints in the echo area the
  768. name of the command that KEY is bound to.  For example, `C-h c C-f'
  769. prints `forward-char'.  Since command names are chosen to describe what
  770. the commands do, this is a good way to get a very brief description of
  771. what KEY does.
  772.  
  773.    `C-h k KEY' is similar but gives more information: it displays the
  774. documentation string of the command as well as its name.  This is too
  775. big for the echo area, so a window is used for the display.
  776.  
  777.    `C-h c' and `C-h k' work for any sort of key sequences, including
  778. function keys and mouse events.
  779.  
  780. 
  781. File: emacs,  Node: Name Help,  Next: Apropos,  Prev: Key Help,  Up: Help
  782.  
  783. Help by Command or Variable Name
  784. ================================
  785.  
  786.    `C-h f' (`describe-function') reads the name of a Lisp function
  787. using the minibuffer, then displays that function's documentation string
  788. in a window.  Since commands are Lisp functions, you can use this to get
  789. the documentation of a command that you know by name.  For example,
  790.  
  791.      C-h f auto-fill-mode RET
  792.  
  793. displays the documentation of `auto-fill-mode'.  This is the only way
  794. to get the documentation of a command that is not bound to any key (one
  795. which you would normally run using `M-x').
  796.  
  797.    `C-h f' is also useful for Lisp functions that you are planning to
  798. use in a Lisp program.  For example, if you have just written the
  799. expression `(make-vector len)' and want to check that you are using
  800. `make-vector' properly, type `C-h f make-vector RET'.  Because `C-h f'
  801. allows all function names, not just command names, you may find that
  802. some of your favorite abbreviations that work in `M-x' don't work in
  803. `C-h f'.  An abbreviation may be unique among command names yet fail to
  804. be unique when other function names are allowed.
  805.  
  806.    The function name for `C-h f' to describe has a default which is
  807. used if you type RET leaving the minibuffer empty.  The default is the
  808. function called by the innermost Lisp expression in the buffer around
  809. point, *provided* that is a valid, defined Lisp function name.  For
  810. example, if point is located following the text `(make-vector (car x)',
  811. the innermost list containing point is the one that starts with
  812. `(make-vector', so the default is to describe the function
  813. `make-vector'.
  814.  
  815.    `C-h f' is often useful just to verify that you have the right
  816. spelling for the function name.  If `C-h f' mentions a default in the
  817. prompt, you have typed the name of a defined Lisp function.  If that is
  818. all you want to know, just type `C-g' to cancel the `C-h f' command,
  819. then go on editing.
  820.  
  821.    `C-h w COMMAND RET' tells you what keys are bound to COMMAND.  It
  822. prints a list of the keys in the echo area.  If it says the command is
  823. not on any key, you must use `M-x' to run it.  `C-h w' runs the command
  824. `where-is'.
  825.  
  826.    `C-h v' (`describe-variable') is like `C-h f' but describes Lisp
  827. variables instead of Lisp functions.  Its default is the Lisp symbol
  828. around or before point, but only if that is the name of a known Lisp
  829. variable.  *Note Variables::.
  830.  
  831. 
  832. File: emacs,  Node: Apropos,  Next: Library Keywords,  Prev: Name Help,  Up: Help
  833.  
  834. Apropos
  835. =======
  836.  
  837.    A more sophisticated sort of question to ask is, "What are the
  838. commands for working with files?"  To ask this question, type `C-h a
  839. file RET', which displays a list of all command names that contain
  840. `file', including `copy-file', `find-file', and so on.  With each
  841. command name appears a brief description of how to use the command, and
  842. what keys you can currently invoke it with.  For example, it would say
  843. that you can invoke `find-file' by typing `C-x C-f'.  The `a' in `C-h
  844. a' stands for `Apropos'; `C-h a' runs the command `command-apropos'.
  845.  
  846.    Because `C-h a' looks only for functions whose names contain the
  847. string which you specify, you must use ingenuity in choosing the
  848. string.  If you are looking for commands for killing backwards and `C-h
  849. a kill-backwards RET' doesn't reveal any, don't give up.  Try just
  850. `kill', or just `backwards', or just `back'.  Be persistent.  Also note
  851. that you can use a regular expression as the argument, for more
  852. flexibility (*note Regexps::.).
  853.  
  854.    Here is a set of arguments to give to `C-h a' that covers many
  855. classes of Emacs commands, since there are strong conventions for naming
  856. the standard Emacs commands.  By giving you a feel for the naming
  857. conventions, this set should also serve to aid you in developing a
  858. technique for picking `apropos' strings.
  859.  
  860.      char, line, word, sentence, paragraph, region, page, sexp, list,
  861.      defun, rect, buffer, frame, window, file, dir, register, mode,
  862.      beginning, end, forward, backward, next, previous, up, down,
  863.      search, goto, kill, delete, mark, insert, yank, fill, indent,
  864.      case, change, set, what, list, find, view, describe.
  865.  
  866.    To list all Lisp symbols that contain a match for a regexp, not just
  867. the ones that are defined as commands, use the command `M-x apropos'
  868. instead of `C-h a'.  This command does not check key bindings by
  869. default; specify a numeric argument if you want it to check them.
  870.  
  871.    The `super-apropos' command is like `apropos' except that it
  872. searches documentation strings as well as symbol names for matches for
  873. the specified regular expression.
  874.  
  875. 
  876. File: emacs,  Node: Library Keywords,  Next: Misc Help,  Prev: Apropos,  Up: Help
  877.  
  878. Keyword Search for Lisp Libraries
  879. =================================
  880.  
  881.    The `C-h p' command lets you search the standard Emacs Lisp
  882. libraries by topic keywords.  Here is a partial list of keywords you can
  883. use:
  884.  
  885. `abbrev'
  886.      Abbreviation handling, typing shortcuts, macros.
  887.  
  888. `bib'
  889.      Support for the bibliography processor `bib'.
  890.  
  891. `c'
  892.      C and C++ language support.
  893.  
  894. `calendar'
  895.      Calendar and time management support.
  896.  
  897. `comm'
  898.      Communications, networking, remote access to files.
  899.  
  900. `docs'
  901.      Support for Emacs documentation.
  902.  
  903. `emulations'
  904.      Emulations of other editors.
  905.  
  906. `extensions'
  907.      Emacs Lisp language extensions.
  908.  
  909. `faces'
  910.      Support for using faces (fonts and colors; *note Faces::.).
  911.  
  912. `games'
  913.      Games, jokes and amusements.
  914.  
  915. `hardware'
  916.      Support for interfacing with exotic hardware.
  917.  
  918. `help'
  919.      Support for on-line help systems.
  920.  
  921. `i18n'
  922.      Internationalization and alternate character-set support.
  923.  
  924. `internal'
  925.      Code for Emacs internals, build process, defaults.
  926.  
  927. `languages'
  928.      Specialized modes for editing programming languages.
  929.  
  930. `lisp'
  931.      Support for using Lisp (including Emacs Lisp).
  932.  
  933. `local'
  934.      Libraries local to your site.
  935.  
  936. `maint'
  937.      Maintenance aids for the Emacs development group.
  938.  
  939. `mail'
  940.      Modes for electronic-mail handling.
  941.  
  942. `news'
  943.      Support for netnews reading and posting.
  944.  
  945. `non-text'
  946.      Support for editing files that are not ordinary text.
  947.  
  948. `processes'
  949.      Process, subshell, compilation, and job control support.
  950.  
  951. `terminals'
  952.      Support for terminal types.
  953.  
  954. `tex'
  955.      Support for the TeX formatter.
  956.  
  957. `tools'
  958.      Programming tools.
  959.  
  960. `unix'
  961.      Front-ends/assistants for, or emulators of, Unix features.
  962.  
  963. `vms'
  964.      Support code for VMS.
  965.  
  966. `wp'
  967.      Word processing.
  968.  
  969. 
  970. File: emacs,  Node: Misc Help,  Prev: Library Keywords,  Up: Help
  971.  
  972. Other Help Commands
  973. ===================
  974.  
  975.    `C-h i' (`info') runs the Info program, which is used for browsing
  976. through structured documentation files.  The entire Emacs manual is
  977. available within Info.  Eventually all the documentation of the GNU
  978. system will be available.  Type `h' after entering Info to run a
  979. tutorial on using Info.
  980.  
  981.    There are two special help commands for accessing Emacs documentation
  982. through Info.  `C-h C-f FUNCTION RET' enters Info and goes straight to
  983. the documentation of the Emacs function FUNCTION.  `C-h C-k KEY' enters
  984. Info and goes straight to the documentation of the key KEY.  These two
  985. keys run the commands `Info-goto-emacs-command-node' and
  986. `Info-goto-emacs-key-command-node'.
  987.  
  988.    If something surprising happens, and you are not sure what commands
  989. you typed, use `C-h l' (`view-lossage').  `C-h l' prints the last 100
  990. command characters you typed in.  If you see commands that you don't
  991. know, you can use `C-h c' to find out what they do.
  992.  
  993.    Emacs has numerous major modes, each of which redefines a few keys
  994. and makes a few other changes in how editing works.  `C-h m'
  995. (`describe-mode') prints documentation on the current major mode, which
  996. normally describes all the commands that are changed in this mode.
  997.  
  998.    `C-h b' (`describe-bindings') and `C-h s' (`describe-syntax')
  999. present other information about the current Emacs mode.  `C-h b'
  1000. displays a list of all the key bindings now in effect; the local
  1001. bindings defined by the current minor modes first, then the local
  1002. bindings defined by the current major mode, and finally the global
  1003. bindings (*note Key Bindings::.).  `C-h s' displays the contents of the
  1004. syntax table, with explanations of each character's syntax (*note
  1005. Syntax::.).
  1006.  
  1007.    You can get a similar list for a particular prefix key by typing
  1008. `C-h' after the prefix key.  (There are a few prefix keys for which
  1009. this does not work--those that provide their own bindings for `C-h'.
  1010. One of these is ESC, because `ESC C-h' is actually `C-M-h', which marks
  1011. a defun.)
  1012.  
  1013.    The other `C-h' options display various files of useful information.
  1014. `C-h C-w' displays the full details on the complete absence of
  1015. warranty for GNU Emacs.  `C-h n' (`view-emacs-news') displays the file
  1016. `emacs/etc/NEWS', which contains documentation on Emacs changes
  1017. arranged chronologically.  `C-h t' (`help-with-tutorial') displays the
  1018. learn-by-doing Emacs tutorial.  `C-h C-c' (`describe-copying') displays
  1019. the file `emacs/etc/COPYING', which tells you the conditions you must
  1020. obey in distributing copies of Emacs.  `C-h C-d'
  1021. (`describe-distribution') displays the file `emacs/etc/DISTRIB', which
  1022. tells you how you can order a copy of the latest version of Emacs.
  1023. `C-h C-p' (`describe-project') displays general information about the
  1024. GNU Project.
  1025.  
  1026. 
  1027. File: emacs,  Node: Mark,  Next: Killing,  Prev: Help,  Up: Top
  1028.  
  1029. The Mark and the Region
  1030. ***********************
  1031.  
  1032.    Many Emacs commands operate on an arbitrary contiguous part of the
  1033. current buffer.  To specify the text for such a command to operate on,
  1034. you set "the mark" at one end of it, and move point to the other end.
  1035. The text between point and the mark is called "the region".  You can
  1036. move point or the mark to adjust the boundaries of the region.  It
  1037. doesn't matter which one is set first chronologically, or which one
  1038. comes earlier in the text.
  1039.  
  1040.    Once the mark has been set, it remains where you put it until it is
  1041. set again at another place.  The mark remains fixed with respect to the
  1042. preceding character if text is inserted or deleted in the buffer.  Each
  1043. Emacs buffer has its own mark, so that when you return to a buffer that
  1044. had been selected previously, it has the same mark it had before.
  1045.  
  1046.    Many commands that insert text, such as `C-y' (`yank') and `M-x
  1047. insert-buffer', position point and the mark at opposite ends of the
  1048. inserted text, so that the region contains the text just inserted.
  1049.  
  1050.    Aside from delimiting the region, the mark is also useful for
  1051. remembering a spot that you may want to go back to.  To make this
  1052. feature more useful, each buffer remembers 16 previous locations of the
  1053. mark in the "mark ring".
  1054.  
  1055. * Menu:
  1056.  
  1057. * Setting Mark::    Commands to set the mark.
  1058. * Transient Mark::    How to make Emacs highlight the region-
  1059.               when there is one.
  1060. * Using Region::    Summary of ways to operate on contents of the region.
  1061. * Marking Objects::    Commands to put region around textual units.
  1062. * Mark Ring::       Previous mark positions saved so you can go back there.
  1063. * Global Mark Ring::    Previous mark positions in various buffers.
  1064.  
  1065. 
  1066. File: emacs,  Node: Setting Mark,  Next: Transient Mark,  Up: Mark
  1067.  
  1068. Setting the Mark
  1069. ================
  1070.  
  1071.    Here are some commands for setting the mark:
  1072.  
  1073. `C-SPC'
  1074.      Set the mark where point is (`set-mark-command').
  1075.  
  1076. `C-@'
  1077.      The same.
  1078.  
  1079. `C-x C-x'
  1080.      Interchange mark and point (`exchange-point-and-mark').
  1081.  
  1082. `Drag-Mouse-1'
  1083.      Set point and the mark around the text you drag across.
  1084.  
  1085. `Mouse-3'
  1086.      Set mark where you click (`mouse-save-then-kill').
  1087.  
  1088.    For example, suppose you wish to convert part of the buffer to all
  1089. upper-case, using the `C-x C-u' (`upcase-region') command which
  1090. operates on the text in the region.  You can first go to the beginning
  1091. of the text to be capitalized, type `C-SPC' to put the mark there, move
  1092. to the end, and then type `C-x C-u'.  Or, you can set the mark at the
  1093. end of the text, move to the beginning, and then type `C-x C-u'.
  1094.  
  1095.    The most common way to set the mark is with the `C-SPC' command
  1096. (`set-mark-command').  This sets the mark where point is.  Then you can
  1097. move point away, leaving the mark behind.
  1098.  
  1099.    There are two ways to set the mark with the mouse.  You can drag
  1100. mouse button one across a range of text; that puts point where you
  1101. release the mouse button, and sets the mark at the other end of that
  1102. range.  Or you can click mouse button three, which simply sets the
  1103. mark, leaving point unchanged.  Both of these methods copy the region
  1104. into the kill ring in addition to setting the mark; that gives behavior
  1105. consistent with other window-driven applications, but if you don't want
  1106. to modify the kill ring, you must use keyboard commands to set the
  1107. mark.  *Note Mouse Commands::.
  1108.  
  1109.    Ordinary terminals have only one cursor, so there is no way for Emacs
  1110. to show you where the mark is located.  You have to remember.  The usual
  1111. solution to this problem is to set the mark and then use it soon, before
  1112. you forget where it is.  Alternatively, you can see where the mark is
  1113. with the command `C-x C-x' (`exchange-point-and-mark') which puts the
  1114. mark where point was and point where the mark was.  The extent of the
  1115. region is unchanged, but the cursor and point are now at the previous
  1116. position of the mark.  In Transient Mark mode, this command reactivates
  1117. the mark.
  1118.  
  1119.    `C-x C-x' is also useful when you are satisfied with the position of
  1120. point but want to move the mark; do `C-x C-x' to put point at that end
  1121. of the region, and then move it.  A second use of `C-x C-x', if
  1122. necessary, puts the mark at the new position with point back at its
  1123. original position.
  1124.  
  1125.    There is no such character as `C-SPC' in ASCII; when you type SPC
  1126. while holding down CTRL, what you get on most ordinary terminals is the
  1127. character `C-@'.  This key is actually bound to `set-mark-command'.
  1128. But unless you are unlucky enough to have a terminal where typing
  1129. `C-SPC' does not produce `C-@', you might as well think of this
  1130. character as `C-SPC'.  Under X, `C-SPC' is actually a distinct
  1131. character, but its binding is still `set-mark-command'.
  1132.  
  1133. 
  1134. File: emacs,  Node: Transient Mark,  Next: Using Region,  Prev: Setting Mark,  Up: Mark
  1135.  
  1136. Transient Mark Mode
  1137. ===================
  1138.  
  1139.    Many Emacs commands move the mark and invisibly set new regions.
  1140. This means that there is almost always some region that you can act on.
  1141. This is convenient, provided you get used to keeping track of the
  1142. mark's position.
  1143.  
  1144.    Some people prefer a more rigid mode of operation in which you must
  1145. set up a region for each command that uses one--in which the region
  1146. "lasts" only temporarily.  This is called Transient Mark mode.  It is
  1147. particularly well-suited to window systems such as X, since Emacs can
  1148. highlight the region when it is active.
  1149.  
  1150.    To enable Transient Mark mode, type `M-x transient-mark-mode'.  This
  1151. command toggles the mode, so you can repeat the command to turn off the
  1152. mode.
  1153.  
  1154.    Here are the details of Transient Mark mode:
  1155.  
  1156.    * To set the mark, type `C-SPC' (`set-mark-command').  This makes
  1157.      the mark active; as you move point, you will see the region
  1158.      highlighting change in extent.
  1159.  
  1160.    * The mouse commands for specifying the mark also make it active.
  1161.      So do keyboard commands whose purpose is to specify a region,
  1162.      including `M-@', `C-M-@', `M-h', `C-M-h', `C-x C-p', and `C-x h'.
  1163.  
  1164.    * When the mark is active, you can execute commands that operate on
  1165.      the region, such as killing, indentation, or writing to a file.
  1166.  
  1167.    * Any change to the buffer, such as inserting or deleting a
  1168.      character, deactivates the mark.  This means any subsequent
  1169.      command that operates on a region will get an error and refuse to
  1170.      operate.  You can make the region active again by typing `C-x C-x'.
  1171.  
  1172.    * Commands like `M->' and `C-s' that "leave the mark behind" in
  1173.      addition to some other primary purpose do not activate the new
  1174.      mark.  You can activate the new region by executing `C-x C-x'
  1175.      (`exchange-point-and-mark').
  1176.  
  1177.    * Quitting with `C-g' deactivates the mark.
  1178.  
  1179.    * When Transient Mark mode is not enabled, every command that sets
  1180.      the mark also activates it, and nothing ever deactivates it.
  1181.  
  1182.    Transient Mark mode is also sometimes known as "Zmacs mode" because
  1183. the Zmacs editor on the MIT Lisp Machine handled the mark in a similar
  1184. way.
  1185.  
  1186.    When multiple windows show the same buffer, they can have different
  1187. regions, because they can have different values of point (though they
  1188. all share common one mark position).  In Transient Mark mode, each
  1189. window highlights its own region.  The part that is highlighted in the
  1190. selected window is the region that editing commands use.  *Note
  1191. Windows::.
  1192.  
  1193.